﻿using System;
using System.Collections.Generic;
using Module.Core.Member;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Data;
using System.Web.UI.WebControls;
using Module.Core.BusinessLogic;
using Module.Core.EntitiesInfo;

namespace Web.Test.ConTrols
{
    public partial class ViewTree : System.Web.UI.UserControl
    {
        #region khai báo
        private string userName = string.Empty;
        #endregion
        protected void Page_Load(object sender, EventArgs e)
        {
            userName = MemberBL.GetValue();
            MemberInfo info = MemberBL.SelectProFile(userName);
            TreeMemBer tree = new TreeMemBer();
            DataTable dt = null;
            if(info != null){
                dt = tree.getTreeFromPoint(info.CodeMember);
                GridView1.DataSource = dt;
                GridView1.DataBind();
            }
        }
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            int dong = GridView1.SelectedIndex;
            String codeMember = GridView1.Rows[dong].Cells[1].Text.Trim();
            String url = "MaTrix.aspx?codeMember=" + codeMember;
            Response.Redirect(url);
        }

        protected void GridView1_PageIndexChanged(object sender, EventArgs e)
        {

        }

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            Int32 maxId = 0;
            int count = 20;
            TreeMemBer tree = new TreeMemBer();
            DataTable dt = null;
            dt = tree.getListMemBer(0,50);
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }

    }
}